// 用户相关类型定义

// 登录表单
export interface LoginForm {
  username: string
  password: string
  captcha?: string
  uuid?: string
  rememberMe?: boolean
}

// 用户信息
export interface UserInfo {
  id: string
  username: string
  nickname: string
  avatar: string
  email: string
  phone: string
  roles: string[]
  permissions: string[]
  deptId: string
  deptName: string
  companyId: string
  companyName: string
}

// 用户列表项
export interface UserListItem {
  id: string
  username: string
  nickname: string
  email: string
  phone: string
  status: number
  createTime: string
  deptName: string
  roles: string[]
}

// 用户查询参数
export interface UserQuery {
  username?: string
  nickname?: string
  phone?: string
  status?: number
  deptId?: string
  companyId?: string
  pageNum: number
  pageSize: number
}

// 用户表单
export interface UserForm {
  id?: string
  username: string
  nickname: string
  email?: string
  phone?: string
  password?: string
  status: number
  deptId: string
  roleIds: string[]
  remark?: string
}

// 修改密码表单
export interface ChangePasswordForm {
  oldPassword: string
  newPassword: string
  confirmPassword: string
}

// 角色信息
export interface RoleInfo {
  id: string
  roleName: string
  roleKey: string
  roleSort: number
  status: number
  remark?: string
  createTime: string
}

// 部门信息
export interface DeptInfo {
  id: string
  parentId: string
  deptName: string
  orderNum: number
  leader?: string
  phone?: string
  email?: string
  status: number
  children?: DeptInfo[]
}

// 公司信息
export interface CompanyInfo {
  id: string
  companyName: string
  companyCode: string
  contactPerson?: string
  contactPhone?: string
  address?: string
  status: number
  createTime: string
}

// API响应类型
export interface ApiResponse<T = any> {
  code: number
  message: string
  data: T
}

// 分页响应
export interface PageResponse<T = any> {
  total: number
  rows: T[]
}

// 登录响应
export interface LoginResponse {
  token: string
  expires: number
}

// 菜单信息
export interface MenuInfo {
  id: string
  parentId: string
  menuName: string
  menuType: string
  path?: string
  component?: string
  icon?: string
  orderNum: number
  visible: number
  status: number
  perms?: string
  children?: MenuInfo[]
}

// 权限信息
export interface PermissionInfo {
  id: string
  permissionName: string
  permissionKey: string
  type: string
  parentId: string
  orderNum: number
  status: number
  children?: PermissionInfo[]
}
